using System.Runtime.Serialization;
using MiniStock.Entities.Common;

namespace MiniStock.Entities.Stock.Events.Product
{
    [DataContract]
    public class ChangeProductDescriptionEvent : ProductEventBase
    {
        [DataMember]
        public string Description { get; set; }

        public override void ValidateFor(EntityBase entity, IEntityProvider provider)
        {
            base.ValidateFor(entity, provider);
            var item = (Stock.Product) entity;
        }

        public override void ApplyTo(EntityBase entity)
        {
            var typedEntity = (Stock.Product) entity;
            typedEntity.Description = this.Description;
        }
    }
}